package com.edward.model;

import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class OtherHarvest {
	
	private int id;
	
	private String type;
	
	private double income;
	
	private double cost;
	
	private Date date;
	
	private List <OtherHarvest> others;
	

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public double getIncome() {
		return income;
	}

	public void setIncome(double income) {
		this.income = income;
	}

	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}

	@Temporal(TemporalType.DATE)
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}


	@OneToMany(fetch = FetchType.EAGER)
	@JoinColumn(name="OTHER_ID")
	public List<OtherHarvest> getOthers() {
		return others;
	}

	public void setOthers(List<OtherHarvest> others) {
		this.others = others;
	}


	

	
	
	
	
	

}
